package day04;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Demo09 {

	public static void main(String[] args) {
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new LinkedList<Integer>();
		for (int i = 0; i < 1000000; i++) {
			list1.add(i);
			list2.add(i);
		}
		Long t1 = System.nanoTime();
		Integer n1 = list1.set(0, 0);
		Long t2 = System.nanoTime();
		Integer n2 = list1.set(500000,50);
		Long t3 = System.nanoTime();
		Integer n3 = list1.set(999999,12);
		Long t4 = System.nanoTime();
		System.out.println((t2 - t1) + "," + (t3 - t2) + "," + (t4 - t3));

		Long t5 = System.nanoTime();
		Integer n4 = list2.set(0,324);
		Long t6 = System.nanoTime();
		Integer n5 = list2.set(500000,323);
		Long t7 = System.nanoTime();
		Integer n6 = list2.set(999999,342);
		Long t8 = System.nanoTime();
		System.out.println((t6 - t5) + "," + (t7 - t6) + "," + (t8 - t7));
	}

}
